﻿using System;
using XSTDZ.ERP.Application.DataContracts;
using System.Collections.Generic;

namespace XSTDZ.ERP.Application
{
    /// <summary>
    /// 调拨服务
    /// </summary>
    public interface IProductAllotService
    {
        #region 调拔订单
       
        /// <summary>
        /// 添加调拔任务单据
        /// </summary>
        /// <param name="productDeliveryBillDto"></param>
        Guid AddProductAllot(ProductAllotDto productAllotDto, IEnumerable<ProductAllotDetailDto> productAllotDetailDtos);
        void UpdateProductAllot(ProductAllotDto productAllotDto, IEnumerable<ProductAllotDetailDto> productAllotDetailDtos);
        Guid AddProductAllot(ProductAllotDto productAllotDto);
        void UpdateProductAllot(ProductAllotDto productAllotDto);

        void ConvertProductAllotDeleteState(Guid productAllotId);
        void ConvertProductAllotDeleteState(Guid productAllotId, IEnumerable<Guid> productAllotDetailIds);

        ProductAllotDto GetProductAllot(Guid productAllotId);
        /// <summary>
        /// 获取调拔信息
        /// </summary>
        /// <param name="pageIndex">页索引(从1开始)</param>
        /// <param name="pageSize">页大小</param>
        /// <param name="isDeleted">是否删除(默认：false)</param>
        /// <param name="isAudited">是否确认(默认：false)</param>
        /// <returns>调拔信息列表</returns>
        IEnumerable<ProductAllotDto> GetProductAllots(out int recordCount,int pageIndex, int pageSize);

        //把生成的盘点单数据更新至库存，会影响库存
        void UpdateToStock(Guid productAllotId, IEnumerable<Guid> productAllotDetailIds);
        #endregion
        #region 调拔订单明细
        void AddProductAllotDetail(Guid productAllotId, ProductAllotDetailDto productAllotDetailDtos);
        void UpdateProductAllotDetail(Guid productAllotId, IEnumerable<ProductAllotDetailDto> productAllotDetailDtos);
        ProductAllotDetailDto GetProductAllotDetail(Guid productAllotDetailId);
        IEnumerable<ProductAllotDetailDto> GetProductAllotDetails(Guid productAllotDetailId);
        /// <summary>
        /// 审核
        /// </summary>
        /// <param name="outBillIds"></param>
        /// <param name="auditId"></param>
        /// <param name="orgId"></param>
        void Audit(IList<Guid> billIds, Guid auditId, Guid orgId);
        #endregion
        #region 其它
        /// <summary>
        /// 获得当前调拔单单号的最大单号
        /// </summary>
        /// <returns></returns>
        string GetMaxBillNo();
        #endregion

    }
}
